<?php
set_time_limit(0);
if (isset($_POST['op']) && isset($_POST['yi'])){
    include '../c/config.php';
    $openid=trim(addslashes($_POST['op']));
    $schoolid=trim(addslashes($_POST['ud']));
    $leftTime=trim(addslashes($_POST['leftTime']));
    $nianji=trim(addslashes($_POST['nianji']));
     
    $mysqli = new mysqli($dbhost, $dbuser, $dbpwd, $dbName);
    $table='dan';
     

    $mysqli->query("INSERT INTO `".$table."` (`id`, `uid`, `nianji`, `schoolid`,`yi`,`createtime`,`lefttime`,`ji`) VALUES (NULL,'".$openid."','".$nianji."','".$schoolid."', '".json_encode($_POST['yi'], JSON_UNESCAPED_UNICODE)."','".date("Y-m-d H:i:s")."','".$leftTime."','1')");
     
    $mysqli->close();
 
    echo json_encode(array('s'=>'y'));
   
 
}else{
    echo json_encode(array('s'=>'n'));
}

?>